package cool.taomu.box.test

import cool.taomu.box.guice.ann.Binder
import cool.taomu.box.tomcat.ITomcatFilter
import cool.taomu.box.tomcat.ITomcatServer
import cool.taomu.box.tomcat.TomcatServer
import javax.servlet.Servlet
import cool.taomu.box.guice.TaomuGuiceModule
import com.google.inject.Guice

@Binder(bind=Servlet,to=HttpServletProvider,provider=true)
@Binder(bind=ITomcatFilter,to=GJerseyTocamtConfig,provider=true)
@Binder(bind=int,named="port",value="8080")
@Binder(bind=ITomcatServer,to=TomcatServer)
class Appaction {
	def static main(String[] args){
		var tgm = new  TaomuGuiceModule();
		var a = Guice.createInjector(tgm.build(Appaction));
		a.getInstance(ITomcatServer).start();
	}
}